import axios from 'axios';

export const updateUserName = async (userId, name) => {
    try {
        const response = await axios.post('/user/updateName', {
            userId,
            name
        });

        return response.data;
    } catch (error) {
        return {
            status: 1001,
            msg: '更新失败，请稍后再试'
        };
    }
};

export const updateUserPassword = async (userId, password) => {
    try {
        const response = await axios.post('/user/updatePassWord', {
            userId,
            password
        });

        return response.data;
    } catch (error) {
        return {
            status: 1001,
            msg: '更新失败，请稍后再试'
        };
    }
};
